IF exists(SELECT * FROM dbo.sysobjects WHERE name='WEB_schooljaar' AND xtype='P') 
BEGIN
	DROP PROCEDURE WEB_schooljaar
END
GO

CREATE  procedure WEB_schooljaar
(@jaar int output)
as
set nocount on

declare @maand int

set @jaar = year(getdate())
set @maand = month(getdate())

if @maand < 9 set @jaar = @jaar - 1

return @jaar